﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BDS3M.Controls
{
    public partial class ListNewsDuAn : System.Web.UI.UserControl
    {
        public static int catid;
        public static int sizepage = 18;
        public static int cur;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (Request.QueryString["ID"] != null)
            {
                if (Request.QueryString["currentPage"] != null)
                {
                    cur = Convert.ToInt32(Request.QueryString["currentPage"].ToString());
                    catid = Convert.ToInt32(Request.QueryString["ID"].ToString());
                    rpt_duan.DataSource = DAL.DCollector.DBCollector.Instance.Paging7Param("paging7Param", "tbl_DuAn", "DuAn_Date", cur.ToString(), sizepage.ToString(), "desc", "Category_ID1", catid.ToString(), true);
                    rpt_duan.DataBind();
                }
                else
                {
                    cur = 1;
                    catid = Convert.ToInt32(Request.QueryString["ID"].ToString());
                    rpt_duan.DataSource = DAL.DCollector.DBCollector.Instance.Paging7Param("paging7Param", "tbl_DuAn", "DuAn_Date", "1", sizepage.ToString(), "desc", "Category_ID1", catid.ToString(), true);
                    rpt_duan.DataBind();
                }
            }
            else
            {
                if (Request.QueryString["currentPage"] != null)
                {
                    cur = Convert.ToInt32(Request.QueryString["currentPage"].ToString());
                    rpt_duan.DataSource = DAL.DCollector.DBCollector.Instance.Paging5Param("paging5Param", "tbl_DuAn", "DuAn_Date", cur.ToString(), sizepage.ToString(), "desc", true);
                    rpt_duan.DataBind();
                }
                else
                {
                    cur = 1;
                    rpt_duan.DataSource = DAL.DCollector.DBCollector.Instance.Paging5Param("paging5Param", "tbl_DuAn", "DuAn_Date", "1", sizepage.ToString(), "desc", true);
                    rpt_duan.DataBind();
                }

            }

        }
    }
}